package core.objects;

import core.objects.enums.LoanStatusEnum;
import java.sql.Timestamp;

public class BookLoan extends ObjectWithID {

	private int bookId;
	private int loanerId;
	private int loanedTo;
	private Timestamp startDate = null;
	private Timestamp endDate = null;
	private LoanStatusEnum status = null;
	
	public BookLoan(int id) {
		super(id);
	}
        
        public BookLoan(int id,int bookId, int loanerId, int loanedToId, Timestamp startTime, 
                Timestamp endTime, LoanStatusEnum status) {
		super(id);
                this.bookId = bookId;
                this.loanerId = loanerId;
                this.loanedTo = loanedToId;
                this.startDate = startTime;
                this.endDate = endTime;
                this.status = status;
	}

	public int getBookId() {
		return bookId;
	}

	public int getLoanerId() {
		return loanerId;
	}

	public int getLoanedTo() {
		return loanedTo;
	}

	public Timestamp getStartDate() {
		return startDate;
	}

	public Timestamp getEndDate() {
		return endDate;
	}

	public LoanStatusEnum getStatus() {
		return status;
	}

	public void setBook(int book) {
		this.bookId = book;
	}

	public void setLoaner(int loaner) {
		this.loanerId = loaner;
	}

	public void setLoanedTo(int loanedTo) {
		this.loanedTo = loanedTo;
	}

	public void setStartDate(Timestamp startDate) {
		this.startDate = startDate;
	}

	public void setEndDate(Timestamp endDate) {
		this.endDate = endDate;
	}

	public void setStatus(LoanStatusEnum status) {
		this.status = status;
	}

    @Override
    public Object[] toObjectArray() {
          return new Object[]{getBookId(), getLoanerId(), getLoanedTo(),getStartDate(),getEndDate(),getStatus()};
    }
}
